package zuoye23.zuoye3;

public class Cat {
    //    3:oop模拟实现猫抓老鼠,
//    猫有名字,体重,体力等属性,老鼠有名字,体力等属性
//,如果老鼠被猫抓住,被咬死,猫体力上涨,老鼠体力变成0;
    private String name;
    private double weight;
    private int health;

    public Cat(String name, double weight, int health) {
        this.name = name;
        this.weight = weight;
        this.health = health;
    }

    public String chi(Mouse mouse){
        return "猫抓住了老鼠，体力上涨，猫的体力变为"+(this.health+100)+"老鼠的体力"+mouse.getHealth()+"变为0";
    }
    public Cat() {
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }
}
